Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

w3c-keyname

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

w3c-keyname

Get a KeyboardEvent.key-style string from an event

  • 2.2.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9M
increased by1.91%
Maintainers
1
Weekly downloads
 
Created

What is w3c-keyname?

The w3c-keyname package is a utility library that helps in converting keyboard event key names to strings that are consistent with the W3C key names specification. This is particularly useful for handling keyboard interactions in web applications in a way that is consistent across different browsers and platforms.

What are w3c-keyname's main functionalities?

Convert key event to W3C key name

This feature allows you to pass a keyboard event object to the `keyName` function, which returns the W3C-compliant key name as a string. This is useful for identifying keys in a standardized manner.

"import { keyName } from 'w3c-keyname';\n\nconst event = new KeyboardEvent('keydown', {key: 'ArrowLeft'});\nconsole.log(keyName(event)); // 'ArrowLeft'"

Other packages similar to w3c-keyname

Keywords

FAQs

Package last updated on 07 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc